
package com.blackline.UI.REPORTS;

import org.apache.log4j.Logger;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

import com.blackline.UI.SessionMenu.sessionMenu;

public class RunPrompts {
	
	private static Logger logger=Logger.getLogger(sessionMenu.class);
	/**
	 * Run Report button
	 */
	@FindBy(xpath = "//div[@id='tbibFiltersRunReport']")
	public WebElement Run_Report_button;
	
	/**
	* Clear button
	*/
	@FindBy(xpath = "//div[@id='tbibFiltersClear']")
	public WebElement Clear_button;

	
	/**
	 * Cancel button
	 */
	@FindBy(xpath = "//div[@id='tbibFiltersCancel']")
	public WebElement Cancel_button;
	
	/**
	 * Run Report Name text
	 */
	@FindBy(xpath = "//input[@id='reportName']")
	public WebElement Run_ReportName_Textbox;
	
	/**
	 * Web Format drop down list item
	 */
	@FindBy(xpath = "//select[@id='reportFormat']/option[1]")
	public WebElement Web_Format_Dropdownlist;
	
	/**
	 * Excel Format drop down list item
	 */
	@FindBy(xpath = "//select[@id='reportFormat']/option[2]")
	public WebElement Excel_Format_Dropdownlist;
	
	/**
	 * PDF Format drop down list item
	 */
	@FindBy(xpath = "//select[@id='reportFormat']/option[3]")
	public WebElement PDF_Format_Dropdownlist;
	
	/**
	 * CSV Format drop down list item
	 */
	@FindBy(xpath = "//select[@id='reportFormat']/option[4]")
	public WebElement CSV_Format_Dropdownlist;
	
	
	/**
	 * GL Account Group drop down list item
	 */
	@FindBy(xpath = "//div[@id='ctl00_ctl00_contentBody_cphMain_promptWindow_promptModal_accountGroupDropdown']/select[@id='groupsPrompt']/option[1]")
	public WebElement GLAcct_Group_Dropdownlist;
	
	/**
	 * GL&Group Account Group drop down list item
	 */
	@FindBy(xpath = "//[@id='ctl00_ctl00_contentBody_cphMain_promptWindow_promptModal_accountGroupDropdown']/select[@id='groupsPrompt']/option[2]")
	public WebElement GLGroupAcct_Group_Dropdownlist;
	
	/**
	 * Group Account Group drop down list item
	 */
	@FindBy(xpath = "//[@id='ctl00_ctl00_contentBody_cphMain_promptWindow_promptModal_accountGroupDropdown']/select[@id='groupsPrompt']/option[3]")
	public WebElement GroupAcct_Group_Dropdownlist;
	
	/**
	 * Reconciliation Group drop down list item
	 */
	@FindBy(xpath = "//[@id='ctl00_ctl00_contentBody_cphMain_promptWindow_promptModal_accountGroupDropdown']/select[@id='groupsPrompt']/option[4]")
	public WebElement Recon_Group_Dropdownlist;
	
	/**
	 * Management Group drop down list item
	 */
	@FindBy(xpath = "//[@id='ctl00_ctl00_contentBody_cphMain_promptWindow_promptModal_accountGroupDropdown']/select[@id='groupsPrompt']/option[5]")
	public WebElement Management_Group_Dropdownlist;
	
	
	/**
	 * All class item drop down list item
	 */
	@FindBy(xpath = "//select[@id='ctl00_ctl00_contentBody_cphMain_promptWindow_promptModal_itemClassDropDown']/option[1]")
	public WebElement All_ClassItem_Dropdownlist;
	
	
	/**
	 * List Component class item drop down list item
	 */
	@FindBy(xpath = "//select[@id='ctl00_ctl00_contentBody_cphMain_promptWindow_promptModal_itemClassDropDown']/option[2]")
	public WebElement ListComponent_ClassItem_Dropdownlist;
	
	/**
	 * Required Adjustment class item drop down list item
	 */
	@FindBy(xpath = "//select[@id='ctl00_ctl00_contentBody_cphMain_promptWindow_promptModal_itemClassDropDown']/option[3]")
	public WebElement RequiredAdjustment_ClassItem_Dropdownlist;
	
	/**
	 * Timing class item drop down list item
	 */
	@FindBy(xpath = "//select[@id='ctl00_ctl00_contentBody_cphMain_promptWindow_promptModal_itemClassDropDown']/option[4]")
	public WebElement Timing_ClassItem_Dropdownlist;
	
	/**
	*Entity input text box
	*/
	@FindBy(xpath = "//input[@id='ctl00_ctl00_contentBody_cphMain_promptWindow_promptModal_entity_entity_typeAhead_Input']")
	public WebElement Entity_InputText;
	
	
	/**
	*Team input text box
	*/
	@FindBy(xpath = "//input[@id='ctl00_ctl00_contentBody_cphMain_promptWindow_promptModal_team_team_typeAhead_Input']")
	public WebElement Team_InputText;
	
	
	/**
	 * Entity input change View
	 */
	@FindBy(xpath = "//table[@class='entity webcontrols_ComboTree_NonRange']/tbody[1]/tr[1]/td[4]/img[1]")
	public WebElement Entity_ChangeView;
	
	/**
	 * Team input change View
	 */
	@FindBy(xpath = "//table[@class='team webcontrols_ComboTree_NonRange']/tbody[1]/tr[1]/td[2]/img[1]")
	public WebElement Team_ChangeView;
	
	
	/**
	 * Based on the string you input, return an according date Web Element under the Periods drop-down list, and click it. <br>
	 * Example: <br> 
	 * <i>private WebDriver driver = new FirefoxDriver(); <br>
	 * this.selectDate(driver, "1/31/2011");<br>
	 * </i>
	 * @param driver The driver to be used.
	 * @param stringOfDate The string of the date, for example "1/31/2011" means "Jan/31/2011"
	 * @return The date web element.
	 */
	public WebElement selectDate(WebDriver driver, String stringOfDate)
	{
		WebElement selectedDate = driver.findElement(By.xpath("//select[@id='ctl00_ctl00_contentBody_cphMain_promptWindow_promptModal_periods_periodsDropDown']/option[text()='"+stringOfDate+"']"));
		selectedDate.click();
		return selectedDate;
	}
	
	
	
	}



